

%% write table

if options.SaveResults

    fid = fopen(['results/ComparisonDEplanner.tex'],'w');

    fprintf(fid,'\\begin{tabular}{lccccc}\n');
    fprintf(fid,'                            & Data       & Baseline   & No pooling       & Est. planner \\\\[1mm] \n');
    fprintf(fid,'\\hline \\\\[-1mm] \n');
    fprintf(fid,'Aggregate unemployment rate & %2.3f      & %2.3f      & %2.3f            & %2.3f           \\\\[1mm] \n' , [ MeanU_data          , MomentsCE.MeanU    , MomentsQO.MeanU    , MomentsPP.MeanU    ] ) ; %VarDecomp(2,1)
    fprintf(fid,'St. dev. unemployment rate  & %2.3f      & %2.3f      & %2.3f            & %2.3f           \\\\[1mm] \n' , [ StdU_data           , MomentsCE.StdU     , MomentsQO.StdU     , MomentsPP.StdU     ] ) ;
    fprintf(fid,'St. dev. log unemp. / emp.  & %2.3f      & %2.3f      & %2.3f            & %2.3f           \\\\[2mm] \n' , [ sqrt(VarUpred_data) , sqrt(MomentsCE.vU) , sqrt(MomentsQO.vU) , sqrt(MomentsPP.vU) ] ) ;
    fprintf(fid,'\\hskip5mm Job losing rate  & %2.0f \\%% & %2.0f \\%% & %2.0f \\%%       & %2.0f \\%%      \\\\[1mm] \n' , [ sep_data_nores      , MomentsCE.vSep2p   , MomentsQO.vSep2p   , MomentsPP.vSep2p   ] ) ;
    fprintf(fid,'\\hskip5mm Job finding rate & %2.0f \\%% & %2.0f \\%% & %2.0f \\%%       & %2.0f \\%%      \\\\[2mm] \n' , [ find_data_nores     , MomentsCE.vFind2p  , MomentsQO.vFind2p  , MomentsPP.vFind2p  ] ) ;
    fprintf(fid,'\\hline\n');
    fprintf(fid,'\\end{tabular}');

    fclose(fid);

end

